<?php
defined('IN_TS') or die('Access Denied.');
include_once "pinyin.php";
//$py = new py_class();
$arrReader = $new['plan']->findAll('reader');
foreach ( $arrReader as $v ){
	/*$arr = str_split($v['reader_name']);

	foreach ($arr as $z){
		$pinyin = $py -> str2py($z);
		echo $pinyin;
		$first = substr($pinyin,0,1);
		if($abb = ''){
			$abb = $first;
		}else{
			$abb = $abb.$first;
		}

	}*/
	$new['plan']->update('reader',array(
		'reader_id'=>$v['reader_id'],
	),array(
		'abbreviate'=> pinyin($v['reader_name'],'first')
	));
}